import request from '@/utils/request'

// 获取供需信息列表
export function getAssoSupplyInfoList(data) {
  return request({
    url: '/api/zgyf/supply/AssoSupplyInfo/getList',
    method: 'post',
    data
  })
}

// 新增供需信息
export function addAssoSupplyInfo(data) {
  return request({
    url: '/api/zgyf/supply/AssoSupplyInfo',
    method: 'post',
    data
  })
}

// 修改供需信息
export function updateAssoSupplyInfo(id, data) {
  return request({
    url: `/api/zgyf/supply/AssoSupplyInfo/${id}`,
    method: 'put',
    data
  })
}

// 删除供需信息
export function delAssoSupplyInfo(id) {
  return request({
    url: `/api/zgyf/supply/AssoSupplyInfo/${id}`,
    method: 'delete'
  })
}

// 批量删除供需信息
export function batchRemoveAssoSupplyInfo(ids) {
  return request({
    url: `/api/zgyf/supply/AssoSupplyInfo/batchRemove/${ids}`,
    method: 'delete'
  })
}

// 审核供需信息
export function approveAssoSupplyInfo(id, data) {
  return request({
    url: `/api/zgyf/supply/AssoSupplyInfo/approve/${id}`,
    method: 'put',
    data
  })
}

// 驳回供需信息
export function unapproveAssoSupplyInfo(id, data) {
  return request({
    url: `/api/zgyf/supply/AssoSupplyInfo/unapprove/${id}`,
    method: 'put',
    data
  })
}

// 关闭供需信息
export function closeAssoSupplyInfo(id) {
  return request({
    url: `/api/zgyf/supply/AssoSupplyInfo/close/${id}`,
    method: 'get'
  })
}

// 获取供需信息详情
export function getAssoSupplyInfo(id) {
  return request({
    url: `/api/zgyf/supply/AssoSupplyInfo/${id}`,
    method: 'get'
  })
}

// 导出供需信息
export function exportAssoSupplyInfo(data) {
  return request({
    url: '/api/zgyf/supply/AssoSupplyInfo/Actions/Export',
    method: 'post',
    data: data
  })
}
